#include "tinyrpc/base/threadpool.h"
using namespace TinyRPC;
#include <iostream>
#include <unistd.h>
void task1(){
    std::cout<<"task 1"<<std::endl;
    sleep(1);
    std::cout<<"task 1"<<std::endl;
}

void task2(){
    std::cout<<"task 2"<<std::endl;
    Coroutine::Yield();
    std::cout<<"task 2"<<std::endl;
}
int main(){
    ThreadPool threadpool(3);
    //threadpool.push(Task(task1, false));
    threadpool.push(Task(task2, true));
    sleep(2);
    std::cout<<"after sleep"<<std::endl;
    threadpool.quit();
}
